package codechicken.wirelessredstone.core;

public class FreqCoord implements Comparable<FreqCoord>
{
	public FreqCoord(double x, double y, double z, int freq)
	{
		this.x = (float) x;
		this.y = (float) y;
		this.z = (float) z;
		this.freq = freq;
	}

	public int compareTo(FreqCoord node2)
	{
		if(freq == node2.freq)
		{
			if(x == node2.x)
			{
				if(z == node2.z)
				{
					if(y == node2.y)
					{
						return 0;
					}
					else
					{
						return y < node2.y ? -1 : 1;
					}
				}
				else
				{
					return z < node2.z ? -1 : 1;
				}
			}
			else
			{
				return x < node2.x ? -1 : 1;
			}
		}
		else
		{
			return freq < node2.freq ? -1 : 1;
		}
	}
	
	public String toString()
	{
		return "["+x+","+y+","+z+" on "+freq+"]";
	}

	public float x;
	public float y;
	public float z;
	public int freq;
}
